<?php
/**
 * oscshop2 B2C电子商务系统
 *
 * ==========================================================================
 * @link      http://www.oscshop.cn/
 * @copyright Copyright (c) 2015-2017 oscshop.cn. 
 * @license   http://www.oscshop.cn/license.html License
 * ==========================================================================
 *
 * @author    李梓钿
 *
 * 会员积分记录
 */
namespace osc\member\controller;
use osc\common\controller\AdminBase;
use think\Db;
class PointsBackend extends AdminBase{
	
	protected function _initialize(){
		parent::_initialize();
		$this->assign('breadcrumb1','会员');
		$this->assign('breadcrumb2','积分记录');		
	}
	
	function index(){
		
		$param=input('param.');
		
		$query=array();
		if(isset($param['username'])){
			$map['Member.username']=['like',"%".$param['username']."%"];
			$query['username']=urlencode($param['username']);
		}
		
		$map['Member.uid']=['gt',0];
		
		$list= Db::view('Member','username')
		->view('Points','*','Member.uid=Points.uid')->where($map)->paginate(config('page_num'),false,$query);
				
		$this->assign('list',$list);
		$this->assign('empty', '<tr><td colspan="20">~~暂无数据</td></tr>');
		return $this->fetch();
	}
	
}
